package ch.usi.inf.pf2.cell;

import junit.framework.TestCase;
import ch.usi.inf.pf2.cell.Data;
import ch.usi.inf.pf2.cell.Formula;
import ch.usi.inf.pf2.cell.Text;
import ch.usi.inf.pf2.cell.Value;

/**
 * @author Lorenzo Baracchi
 */
public class TestData extends TestCase
{
    public void testCreateDataText()
    {
	   Data d = Data.createData("foobar");
	   assertEquals(true, d instanceof Text);
    }

    public void testCreateDataValue()
    {
	   Data d = Data.createData("2.2");
	   assertEquals(true, d instanceof Value);
    }

    public void testCreateDataValueInteger()
    {
	   Data d = Data.createData("2");
	   assertEquals(true, d instanceof Value);
    }

    public void testCreateDataFormula()
    {
	   Data d = Data.createData("=2.2*$A$1");
	   assertEquals(true, d instanceof Formula);
    }
}